<template>
    <div>
        <div class="cont-col3-hd clearfix">
            <div class="cont-col3-box2">
                <span>金额 </span>
                <input type="number" class="bet-money" v-model="selfBetNumber" @input="changeBetNumberHandle">
                <a href="javascript:void(0)" class="u-btn1 btn-submit" @click="submit">确定</a>
                <a href="javascript:void(0)" class="u-btn1 btn-reset" @click="reset">重置</a>
            </div>
        </div>
    </div>

</template>

<script>
    import {mapState} from "vuex";
    export default {
        name: "SubmitComponent",
        data() {
            return {
                selfBetNumber: 0
            }
        },
        mounted() {
            this.selfBetNumber = this.betNumber
        },
        computed:{
            ...mapState(['betNumber'])
        },
        watch:{
            betNumber(nVal){
                this.selfBetNumber = nVal
            }
        },
        methods: {

            changeBetNumberHandle() {
                this.$store.commit('SetBetNumber',this.selfBetNumber)
            },
            reset(){
                this.$emit('reset')
            },
            submit(){
                this.$emit('submit')
            }
        }
    }
</script>

<style scoped>

</style>